package com.lam.mall.mapper;
import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lam.common.base.page.PageVo;
import com.lam.mall.app.vo.MyOrderVo;
import com.lam.mall.app.vo.OrderCountDataVo;
import com.lam.mall.entity.Order;

/**
 * 订单管理Mapper接口
 * 
 * @author admin
 * @date 2023-04-25
 */
public interface OrderMapper extends BaseMapper<Order>{


	/**
     * 根据用户id和订单状态获取订单列表
     * @param adapter
     * @param userId
     * @param status
     * @return
     */
    List<MyOrderVo> listByUserId(@Param("pageVo")PageVo pageVo, @Param("userId") String userId, @Param("status") Integer status);
    
    Long listByUserIdCount(@Param("userId") String userId, @Param("status") Integer status);
    
    String isTimeoutOrder(@Param("orderNumber") String orderNumber);
    
	int cancelOrder(@Param("order")Order order);
	
	int confirmOrder(@Param("order")Order order);
	
	int deleteOrders(@Param("orders")List<Order> orders);
	
	OrderCountDataVo getOrderCount(@Param("userId")String userId);
	
	int updateByToPaySuccess(@Param("orderNumbers")List<String> orderNumbers, @Param("payType")Integer payType,
			@Param("payAmt")BigDecimal payAmt);

}
